<% content_for :sidebar do %>
  <%= sidebar_button_link 'New Item Type', new_item_type_path if can? :create, ItemType %>
<% end %>

<table id="item_types" class="generic_datatable table table-striped table-bordered" >
  <caption><h3><%= @page_title %></h3></caption>
  <thead>
    <tr>
      <th>Name</th>
      <th>Status</th>
      <th>Is groupable</th>
      <th>Is a group</th>
      <th>Parent</th>
      <th></th>
    </tr>
  </thead>

  <tbody>
    <% @item_types.each do |item_type| %>
      <tr>
        <td><%= link_to item_type.name, item_type %></td>
        <td><%= item_type.status %></td>
        <td><%= item_type.is_groupable %></td>
        <td><%= item_type.is_a_group %></td>
        <td><%= item_type.parent_id %></td>
        <td><%= table_button_link 'Edit', edit_item_type_path(item_type) %></td>
      </tr>
    <% end %>
  </tbody>
</table>
